package com.aegean.MonitorExamSYS.conduction.action;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.aegean.MonitorExaxSYS.model.ConductionValue;
import com.opensymphony.xwork2.ActionSupport;
@Controller("LoginoutConduction")
@Scope("prototype")
public class LoginoutConduction extends ActionSupport {
	private ConductionValue conduction;
	private boolean success;
	private String msg;
	
	public ConductionValue getConduction() {
		return conduction;
	}

	public void setConduction(ConductionValue conduction) {
		this.conduction = conduction;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		HttpSession session=ServletActionContext.getRequest().getSession();
		if(session.getAttribute("ConductionLogin")==null){
			msg="对不起，您注销的信息出错，请再次尝试！";
			success=false;
		}else{
			msg="注销成功，页面正在跳转........";
			session.removeAttribute("ConductionLogin");
			success=true;
		}
		return SUCCESS;
	}

}
